<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Attach_model extends CI_Model {

    public $tablename = 'hpg_attach';
    
    public function __construct()
    {
        parent::__construct();
    }
    
    public function insert($data){
        $res = $this->db->insert($this->tablename, $data);
        return $this->db->insert_id();
    }
    
    public function getListByIds($ids){
        if(!$ids){
            return false;
        }
        $result = $this->db->from($this->tablename)->where_in('id', $ids)->get_array();
        return $result ? $result : [];
    }
    
}